<template>
  <div>
    <div class="resource-manage">
      <div class="card-box">
        <div class="card-title">
          基本信息
          <div slot="foot" style="text-align: center;height: 50px;  padding:10px;">
            <el-button type="primary" size="small" @click="$refs.registrationOcrAdd.show()" style="width: 80px">扫描</el-button>
          </div>
        </div>

        <el-form ref="ruleForm" :model="formObj" size="small" :rules="rules" label-width="100px">
          <el-row>
            <el-col :span="12">
              <el-form-item label="登记单位" prop="registrationUnit">
                <el-input v-model="formObj.registrationUnit" placeholder="请输入" maxlength="30"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="填表日期" prop="registerDate">
                <el-date-picker
                  maxlength="30"
                  v-model="formObj.registerDate"
                  type="datetime"
                  value-format=" yyyy-MM-dd HH:mm:ss"
                  format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择日期时间"
                ></el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>
          <table class="table table-bordered text-center" cellspacing="0">
            <tbody>
              <tr>
                <td colspan="2" class="td">建设单位</td>
                <td>
                  <el-form-item prop="constructionUnit">
                    <el-input v-model="formObj.constructionUnit" placeholder="请输入" maxlength="30"></el-input>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td colspan="2" class="td">项目建设地址</td>
                <td>
                  <el-form-item label prop="constructionAddress">
                    <el-input
                      v-model="
                                                formObj.constructionAddress
                                            "
                      placeholder="请输入"
                      maxlength="50"
                    ></el-input>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td colspan="2" class="td">设计立项文号</td>
                <td>
                  <el-form-item label prop="approvalDocumentNo">
                    <el-input v-model="formObj.approvalDocumentNo" placeholder="请输入" maxlength="30"></el-input>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td colspan="2" class="td">建设开始日期</td>
                <td>
                  <el-form-item label prop="constructionStartTime">
                    <el-date-picker
                      maxlength="30"
                      v-model="
                                                formObj.constructionStartTime
                                            "
                      type="datetime"
                      value-format=" yyyy-MM-dd HH:mm:ss"
                      format="yyyy-MM-dd HH:mm:ss"
                      placeholder="选择日期时间"
                    ></el-date-picker>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td colspan="2" class="td">竣工日期</td>
                <td>
                  <el-form-item label prop="completedTime">
                    <el-date-picker
                      maxlength="30"
                      v-model="formObj.completedTime"
                      type="datetime"
                      value-format=" yyyy-MM-dd HH:mm:ss"
                      format="yyyy-MM-dd HH:mm:ss"
                      placeholder="选择日期时间"
                    ></el-date-picker>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td colspan="2" class="td">决算批复文号</td>
                <td>
                  <el-form-item label prop="finalAccountsDocumentNo">
                    <el-input
                      v-model="
                                                formObj.finalAccountsDocumentNo
                                            "
                      placeholder="请输入"
                      maxlength="30"
                    ></el-input>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td colspan="2" class="td">资产占用单位</td>
                <td>
                  <el-form-item label prop="assetOccupyingUnit">
                    <el-input v-model="formObj.assetOccupyingUnit" placeholder="请输入" maxlength="30"></el-input>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td colspan="2" class="td">上级主管单位</td>
                <td>
                  <el-form-item label prop="superiorCompetentUnit">
                    <el-input
                      v-model="
                                                formObj.superiorCompetentUnit
                                            "
                      placeholder="请输入"
                      maxlength="30"
                    ></el-input>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td colspan="2" class="td">资产使用单位</td>
                <td>
                  <el-form-item label prop="assetUseUnit">
                    <el-input v-model="formObj.assetUseUnit" placeholder="请输入" maxlength="30"></el-input>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td width="300" rowspan="5">实际形成资产（单位：元）</td>
                <td width="200">固定资产</td>
                <td>
                  <el-form-item label prop="fixedAssets">
                    <el-input v-model="formObj.fixedAssets" v-on:blur="calculationTotal" placeholder="请输入" maxlength="15"></el-input>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td>流动资产</td>
                <td>
                  <el-form-item label prop="currentAssets">
                    <el-input
                      v-model="
                                                formObj.currentAssets
                                            "
                      v-on:blur="calculationTotal"
                      placeholder="请输入"
                      maxlength="15"
                    ></el-input>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td>无形资产</td>
                <td>
                  <el-form-item label prop="intangibleAssets">
                    <el-input
                      v-model="
                                                formObj.intangibleAssets
                                            "
                      v-on:blur="calculationTotal"
                      placeholder="请输入"
                      maxlength="15"
                    ></el-input>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td>递延资产</td>
                <td>
                  <el-form-item label prop="deferredAssets">
                    <el-input
                      v-model="
                                                formObj.deferredAssets
                                            "
                      v-on:blur="calculationTotal"
                      placeholder="请输入"
                      maxlength="15"
                    />
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td>其他资产</td>
                <td>
                  <el-form-item label prop="otherAssets" class="col-two">
                    <el-input v-model="formObj.otherAssets" v-on:blur="calculationTotal" placeholder="请输入" maxlength="15" />
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td>不形成资产（单位：元）</td>
                <td>待核销基建支出</td>
                <td>
                  <el-form-item label prop="stayWriteOffExpenditure" class="full">
                    <el-input
                      v-model="
                            formObj.stayWriteOffExpenditure"
                      v-on:blur="calculationTotal"
                      placeholder="请输入"
                      maxlength="15"
                    ></el-input>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td colspan="2">合计（单位：元）</td>
                <td>
                  <el-form-item label prop="total">
                    <el-input v-model="formObj.total" v-on:blur="calculationTotal" placeholder="请输入" maxlength="15"></el-input>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <td colspan="2">备注</td>
                <td>
                  <el-form-item label prop="remarks" class="full">
                    <el-input v-model="formObj.remarks" placeholder="请输入" maxlength="50"></el-input>
                  </el-form-item>
                </td>
              </tr>
            </tbody>
          </table>
          <el-row>
            <el-col :span="8">
              <el-form-item label="填报人" prop="filledBy">
                <el-input v-model="formObj.filledBy" placeholder="请输入" maxlength="30"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="复核人" prop="reviewer">
                <el-input v-model="formObj.reviewer" placeholder="请输入" maxlength="30"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="单位负责人" prop="personInCharge">
                <el-input v-model="formObj.personInCharge" placeholder="请输入" maxlength="30"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-form-item label="附件信息" prop class="full"></el-form-item>

          <v-upload
            class="full"
            type="file"
            :busId="busId"
            @onSuccess="onSuccess"
            :modelType="modelType"
            ref="registrationAddFile"
            :isView="false"
            v-model="fileList"
          />
        </el-form>
        <div slot="foot" style="text-align: center;height: 50px;  padding:10px;">
          <el-button type="primary" size="small" @click="$router.push('/asset-management/registration-list')" style="width: 80px" plain>返回</el-button>
          <el-button size="small" @click="$refs['ruleForm'].resetFields()" style="width: 80px">重置</el-button>
          <el-button type="primary" size="small" v-throttle="[sendData]" style="width: 80px">保存</el-button>
        </div>
      </div>
    </div>
    <registration-ocr-add ref="registrationOcrAdd"></registration-ocr-add>
  </div>
</template>

<script src="./registration-add.js"></script>

<style scoped lang="scss">
@import "./registration-add";

@include formWrap(4);
</style>
